<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CreateMessageReplyTable extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('message_reply', ['id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '消息回复表']);
        $table->addColumn('id', 'integer', ['identity' => true, 'signed' => false, 'limit' => 11, 'comment' => '回复消息组ID'])
            ->addColumn('message_main_id', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '消息组主消息'])
            ->addColumn('created_by', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '消息组创建人'])
            ->addColumn('created', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '创建时间'])
            ->addColumn('updated', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '修改时间'])
            ->save();
    }

    public function down()
    {
        $this->table('message_reply')->drop()->save();
    }
}
